<template>
	<live-index v-if="dataList" :dataList="dataList" :parameter="parameter"></live-index>
</template>

<script>
import liveIndex from '@/pagecomponents/liveIndex/index.vue';
export default {
	props: ['templateItem'],
	components: {
		liveIndex
	},
	data() {
		return {
			dataList:[],
			parameter:{}
		};
	},
	// templateItem居然不能覆盖混入的？？？可恶
	watch: {
		templateItem: {
			handler(item) {
				if (item.code) {
					this.initList(item);
				}
			},
			immediate: true
		}
	},
	mounted() {},
	methods: {
		initList() {
			this.parameter = {
				...this.templateItem.parameter,
			};
			this.$resPost('GetLiveInfo', { type:1,limit: 5 }).then(({ data }) => {
				this.dataList = data.room_info || []
			});
		}
	}
};
</script>

<style scoped lang="scss"></style>
